package com.ruoyi.hxf.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.common.core.mapper.BaseMapperPlus;

import com.ruoyi.hxf.domain.Comment;
import com.ruoyi.hxf.domain.Topic;
import org.apache.ibatis.annotations.Param;

/**
 * 评论管理Mapper接口
 *
 * @author hxf
 * @date 2022-1-22
 */
public interface CommentMapper  extends BaseMapperPlus<CommentMapper, Comment,Comment > {

    Page<Comment> selectPageAndUser(@Param("page")Page<Comment> build, @Param(Constants.WRAPPER) Wrapper<Comment> lqw);

    Page<Comment> selectPageChildrenAndUser(@Param("page")Page<Comment> build, @Param(Constants.WRAPPER) Wrapper<Comment> lqw);

    Comment select(Comment comment);

    boolean selectCommentLike(@Param("commentId")String commentId,@Param("userId") String userId,@Param("type")String type);

    void updateCommentLike(@Param("commentId")String commentId,@Param("userId") String userId,@Param("status") String status,@Param("type")String type);

    void insertCommentLike(@Param("commentId")String commentId,@Param("userId") String userId,@Param("status") String status,@Param("type")String type);

    String selectCollectionByUserIdAndCommentId(@Param("userId") Long userId,@Param("commentId")  Long commentId,@Param("type")String type);
}
